package com.nacos.example.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author wy
 * @date 2022/04/24
 * @description PropertySource和ConfigurationProperties结合读取指定路径的文件
 */
@Component
@PropertySource("classpath:config.properties")
@ConfigurationProperties(prefix = "teacher")
public class TestConfiguration2 {

    private String name;
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
